/**
 * 提示窗口
 * by wyy
 */
class tipWindow extends GameObject implements eui.UIComponent {
    public windowGrp: eui.Group;
    public textLbl: eui.Label;
    public btn: eui.Button;

    private data;

    widthPercent = 1;
    heightPercent = 1;

    constructor({ text = "中秋博饼", btnText = "确定", func =
        function () { SceneManager.getInstance().closeWindow() } }) {
        super();
        this.skinName = "resource/eui_skins/game_skins/tipWindowSkin.exml";
        this.data = {
            text: text,
            btnText: btnText,
            func: func
        };
    }
    addToStage() { }
    onRemove() { }
    firstCreate() {
        this.textLbl.text = this.data.text;
        this.btn.label = this.data.btnText;
        this.btnFunc = this.data.func;
        this.btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.btnFunc, this);
    }
    btnFunc() {

    }
    childrenResize() {
        this.childResize({ xPercent: 0.5, yPercent: 0.5, widthPercent: 0.6 }, this.windowGrp);
    }
}